package com.mdd.common.enums;

/**
 * redis 枚举
 */
public enum SourceTypeEnum {
    ENGINEER_ID("engineer_id", "入驻师傅"),
    BUSINESS_ID("business_id", "入驻商户"),

    ARTICLE_CATEGORY_ID("article_category_id", "文章分类"),

    PUSH_INFO_ID("push_info_id", "发布信息");

    private String key;
    private String desc;

    SourceTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByKey(String key) {
        for (SourceTypeEnum item : SourceTypeEnum.values()) {
            if (key.equals(item.getKey())) {
                return item.getDesc();
            }
        }
        return "";
    }
}
